/**
 * 
 */
package cc.rico.utils;

import org.apache.shiro.crypto.RandomNumberGenerator;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.util.ByteSource;

/**
 * 盐值生成工具类
 * @author JiWo 2016年6月22日
 *
 */
public class SaltGenerator {
	private static RandomNumberGenerator generator = new SecureRandomNumberGenerator();
	
	public static ByteSource generateSalt() {
		ByteSource salt = generator.nextBytes();
		return salt;
	}
	
	public static ByteSource generateSalt(int num) {
		ByteSource salt = generator.nextBytes(num);
		return salt;
	}
	
}
